package com.dong.service;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * The <code>com.dong.service.OrderServerImpl</code> class have to be described
 *
 * <p>
 * The <code>OrderServerImpl</code> class have to be detailed For example:
 * <p>
 *
 * @author zhaoxdd
 * @date 2021/8/11 22:51
 * @see
 * @since 1.0
 */
@Service
public class OrderServerImpl {

    @Resource
    private JdbcTemplate jdbcTemplate;

    @Transactional()
    public void save(){
        jdbcTemplate.update("INSERT INTO test.TB_ORDER(ID, ORDER_ID) VALUES (?, ?)",1,"ENS210101202104191006");

        int i = 1/0;

        jdbcTemplate.update("INSERT INTO test.TB_ORDER(ID, ORDER_ID) VALUES (?, ?)",2,"ENS210101202104191006");

    }

}